/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package it.apuliait.service.persistence;

import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
import com.liferay.portal.kernel.dao.orm.FinderPath;
import com.liferay.portal.kernel.dao.orm.Query;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.InstanceFactory;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.UnmodifiableList;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.ModelListener;
import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;

import it.apuliait.NoSuchTrasportoDocumentoException;

import it.apuliait.model.TrasportoDocumento;
import it.apuliait.model.impl.TrasportoDocumentoImpl;
import it.apuliait.model.impl.TrasportoDocumentoModelImpl;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * The persistence implementation for the trasporto documento service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Donatello
 * @see TrasportoDocumentoPersistence
 * @see TrasportoDocumentoUtil
 * @generated
 */
public class TrasportoDocumentoPersistenceImpl extends BasePersistenceImpl<TrasportoDocumento>
	implements TrasportoDocumentoPersistence {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. Always use {@link TrasportoDocumentoUtil} to access the trasporto documento persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */
	public static final String FINDER_CLASS_NAME_ENTITY = TrasportoDocumentoImpl.class.getName();
	public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
		".List1";
	public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
		".List2";
	public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
			TrasportoDocumentoModelImpl.FINDER_CACHE_ENABLED,
			TrasportoDocumentoImpl.class,
			FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
	public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
			TrasportoDocumentoModelImpl.FINDER_CACHE_ENABLED,
			TrasportoDocumentoImpl.class,
			FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
	public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
			TrasportoDocumentoModelImpl.FINDER_CACHE_ENABLED, Long.class,
			FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);

	public TrasportoDocumentoPersistenceImpl() {
		setModelClass(TrasportoDocumento.class);
	}

	/**
	 * Caches the trasporto documento in the entity cache if it is enabled.
	 *
	 * @param trasportoDocumento the trasporto documento
	 */
	@Override
	public void cacheResult(TrasportoDocumento trasportoDocumento) {
		EntityCacheUtil.putResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
			TrasportoDocumentoImpl.class, trasportoDocumento.getPrimaryKey(),
			trasportoDocumento);

		trasportoDocumento.resetOriginalValues();
	}

	/**
	 * Caches the trasporto documentos in the entity cache if it is enabled.
	 *
	 * @param trasportoDocumentos the trasporto documentos
	 */
	@Override
	public void cacheResult(List<TrasportoDocumento> trasportoDocumentos) {
		for (TrasportoDocumento trasportoDocumento : trasportoDocumentos) {
			if (EntityCacheUtil.getResult(
						TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
						TrasportoDocumentoImpl.class,
						trasportoDocumento.getPrimaryKey()) == null) {
				cacheResult(trasportoDocumento);
			}
			else {
				trasportoDocumento.resetOriginalValues();
			}
		}
	}

	/**
	 * Clears the cache for all trasporto documentos.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	@Override
	public void clearCache() {
		if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
			CacheRegistryUtil.clear(TrasportoDocumentoImpl.class.getName());
		}

		EntityCacheUtil.clearCache(TrasportoDocumentoImpl.class.getName());

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	/**
	 * Clears the cache for the trasporto documento.
	 *
	 * <p>
	 * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
	 * </p>
	 */
	@Override
	public void clearCache(TrasportoDocumento trasportoDocumento) {
		EntityCacheUtil.removeResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
			TrasportoDocumentoImpl.class, trasportoDocumento.getPrimaryKey());

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	@Override
	public void clearCache(List<TrasportoDocumento> trasportoDocumentos) {
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);

		for (TrasportoDocumento trasportoDocumento : trasportoDocumentos) {
			EntityCacheUtil.removeResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
				TrasportoDocumentoImpl.class, trasportoDocumento.getPrimaryKey());
		}
	}

	/**
	 * Creates a new trasporto documento with the primary key. Does not add the trasporto documento to the database.
	 *
	 * @param trasportoId the primary key for the new trasporto documento
	 * @return the new trasporto documento
	 */
	@Override
	public TrasportoDocumento create(long trasportoId) {
		TrasportoDocumento trasportoDocumento = new TrasportoDocumentoImpl();

		trasportoDocumento.setNew(true);
		trasportoDocumento.setPrimaryKey(trasportoId);

		return trasportoDocumento;
	}

	/**
	 * Removes the trasporto documento with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param trasportoId the primary key of the trasporto documento
	 * @return the trasporto documento that was removed
	 * @throws it.apuliait.NoSuchTrasportoDocumentoException if a trasporto documento with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public TrasportoDocumento remove(long trasportoId)
		throws NoSuchTrasportoDocumentoException, SystemException {
		return remove((Serializable)trasportoId);
	}

	/**
	 * Removes the trasporto documento with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param primaryKey the primary key of the trasporto documento
	 * @return the trasporto documento that was removed
	 * @throws it.apuliait.NoSuchTrasportoDocumentoException if a trasporto documento with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public TrasportoDocumento remove(Serializable primaryKey)
		throws NoSuchTrasportoDocumentoException, SystemException {
		Session session = null;

		try {
			session = openSession();

			TrasportoDocumento trasportoDocumento = (TrasportoDocumento)session.get(TrasportoDocumentoImpl.class,
					primaryKey);

			if (trasportoDocumento == null) {
				if (_log.isWarnEnabled()) {
					_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
				}

				throw new NoSuchTrasportoDocumentoException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
					primaryKey);
			}

			return remove(trasportoDocumento);
		}
		catch (NoSuchTrasportoDocumentoException nsee) {
			throw nsee;
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}

	@Override
	protected TrasportoDocumento removeImpl(
		TrasportoDocumento trasportoDocumento) throws SystemException {
		trasportoDocumento = toUnwrappedModel(trasportoDocumento);

		Session session = null;

		try {
			session = openSession();

			if (!session.contains(trasportoDocumento)) {
				trasportoDocumento = (TrasportoDocumento)session.get(TrasportoDocumentoImpl.class,
						trasportoDocumento.getPrimaryKeyObj());
			}

			if (trasportoDocumento != null) {
				session.delete(trasportoDocumento);
			}
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		if (trasportoDocumento != null) {
			clearCache(trasportoDocumento);
		}

		return trasportoDocumento;
	}

	@Override
	public TrasportoDocumento updateImpl(
		it.apuliait.model.TrasportoDocumento trasportoDocumento)
		throws SystemException {
		trasportoDocumento = toUnwrappedModel(trasportoDocumento);

		boolean isNew = trasportoDocumento.isNew();

		Session session = null;

		try {
			session = openSession();

			if (trasportoDocumento.isNew()) {
				session.save(trasportoDocumento);

				trasportoDocumento.setNew(false);
			}
			else {
				session.merge(trasportoDocumento);
			}
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}

		FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

		if (isNew) {
			FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
		}

		EntityCacheUtil.putResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
			TrasportoDocumentoImpl.class, trasportoDocumento.getPrimaryKey(),
			trasportoDocumento);

		return trasportoDocumento;
	}

	protected TrasportoDocumento toUnwrappedModel(
		TrasportoDocumento trasportoDocumento) {
		if (trasportoDocumento instanceof TrasportoDocumentoImpl) {
			return trasportoDocumento;
		}

		TrasportoDocumentoImpl trasportoDocumentoImpl = new TrasportoDocumentoImpl();

		trasportoDocumentoImpl.setNew(trasportoDocumento.isNew());
		trasportoDocumentoImpl.setPrimaryKey(trasportoDocumento.getPrimaryKey());

		trasportoDocumentoImpl.setTrasportoId(trasportoDocumento.getTrasportoId());
		trasportoDocumentoImpl.setNumeroTrasporto(trasportoDocumento.getNumeroTrasporto());
		trasportoDocumentoImpl.setDataTrasporto(trasportoDocumento.getDataTrasporto());
		trasportoDocumentoImpl.setLineaFatturaIDFK(trasportoDocumento.getLineaFatturaIDFK());
		trasportoDocumentoImpl.setDocumentoIDFK(trasportoDocumento.getDocumentoIDFK());

		return trasportoDocumentoImpl;
	}

	/**
	 * Returns the trasporto documento with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
	 *
	 * @param primaryKey the primary key of the trasporto documento
	 * @return the trasporto documento
	 * @throws it.apuliait.NoSuchTrasportoDocumentoException if a trasporto documento with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public TrasportoDocumento findByPrimaryKey(Serializable primaryKey)
		throws NoSuchTrasportoDocumentoException, SystemException {
		TrasportoDocumento trasportoDocumento = fetchByPrimaryKey(primaryKey);

		if (trasportoDocumento == null) {
			if (_log.isWarnEnabled()) {
				_log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
			}

			throw new NoSuchTrasportoDocumentoException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
				primaryKey);
		}

		return trasportoDocumento;
	}

	/**
	 * Returns the trasporto documento with the primary key or throws a {@link it.apuliait.NoSuchTrasportoDocumentoException} if it could not be found.
	 *
	 * @param trasportoId the primary key of the trasporto documento
	 * @return the trasporto documento
	 * @throws it.apuliait.NoSuchTrasportoDocumentoException if a trasporto documento with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public TrasportoDocumento findByPrimaryKey(long trasportoId)
		throws NoSuchTrasportoDocumentoException, SystemException {
		return findByPrimaryKey((Serializable)trasportoId);
	}

	/**
	 * Returns the trasporto documento with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param primaryKey the primary key of the trasporto documento
	 * @return the trasporto documento, or <code>null</code> if a trasporto documento with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public TrasportoDocumento fetchByPrimaryKey(Serializable primaryKey)
		throws SystemException {
		TrasportoDocumento trasportoDocumento = (TrasportoDocumento)EntityCacheUtil.getResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
				TrasportoDocumentoImpl.class, primaryKey);

		if (trasportoDocumento == _nullTrasportoDocumento) {
			return null;
		}

		if (trasportoDocumento == null) {
			Session session = null;

			try {
				session = openSession();

				trasportoDocumento = (TrasportoDocumento)session.get(TrasportoDocumentoImpl.class,
						primaryKey);

				if (trasportoDocumento != null) {
					cacheResult(trasportoDocumento);
				}
				else {
					EntityCacheUtil.putResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
						TrasportoDocumentoImpl.class, primaryKey,
						_nullTrasportoDocumento);
				}
			}
			catch (Exception e) {
				EntityCacheUtil.removeResult(TrasportoDocumentoModelImpl.ENTITY_CACHE_ENABLED,
					TrasportoDocumentoImpl.class, primaryKey);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return trasportoDocumento;
	}

	/**
	 * Returns the trasporto documento with the primary key or returns <code>null</code> if it could not be found.
	 *
	 * @param trasportoId the primary key of the trasporto documento
	 * @return the trasporto documento, or <code>null</code> if a trasporto documento with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public TrasportoDocumento fetchByPrimaryKey(long trasportoId)
		throws SystemException {
		return fetchByPrimaryKey((Serializable)trasportoId);
	}

	/**
	 * Returns all the trasporto documentos.
	 *
	 * @return the trasporto documentos
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public List<TrasportoDocumento> findAll() throws SystemException {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}

	/**
	 * Returns a range of all the trasporto documentos.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.apuliait.model.impl.TrasportoDocumentoModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
	 * </p>
	 *
	 * @param start the lower bound of the range of trasporto documentos
	 * @param end the upper bound of the range of trasporto documentos (not inclusive)
	 * @return the range of trasporto documentos
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public List<TrasportoDocumento> findAll(int start, int end)
		throws SystemException {
		return findAll(start, end, null);
	}

	/**
	 * Returns an ordered range of all the trasporto documentos.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link it.apuliait.model.impl.TrasportoDocumentoModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
	 * </p>
	 *
	 * @param start the lower bound of the range of trasporto documentos
	 * @param end the upper bound of the range of trasporto documentos (not inclusive)
	 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	 * @return the ordered range of trasporto documentos
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public List<TrasportoDocumento> findAll(int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		boolean pagination = true;
		FinderPath finderPath = null;
		Object[] finderArgs = null;

		if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
				(orderByComparator == null)) {
			pagination = false;
			finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
			finderArgs = FINDER_ARGS_EMPTY;
		}
		else {
			finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
			finderArgs = new Object[] { start, end, orderByComparator };
		}

		List<TrasportoDocumento> list = (List<TrasportoDocumento>)FinderCacheUtil.getResult(finderPath,
				finderArgs, this);

		if (list == null) {
			StringBundler query = null;
			String sql = null;

			if (orderByComparator != null) {
				query = new StringBundler(2 +
						(orderByComparator.getOrderByFields().length * 3));

				query.append(_SQL_SELECT_TRASPORTODOCUMENTO);

				appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
					orderByComparator);

				sql = query.toString();
			}
			else {
				sql = _SQL_SELECT_TRASPORTODOCUMENTO;

				if (pagination) {
					sql = sql.concat(TrasportoDocumentoModelImpl.ORDER_BY_JPQL);
				}
			}

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				if (!pagination) {
					list = (List<TrasportoDocumento>)QueryUtil.list(q,
							getDialect(), start, end, false);

					Collections.sort(list);

					list = new UnmodifiableList<TrasportoDocumento>(list);
				}
				else {
					list = (List<TrasportoDocumento>)QueryUtil.list(q,
							getDialect(), start, end);
				}

				cacheResult(list);

				FinderCacheUtil.putResult(finderPath, finderArgs, list);
			}
			catch (Exception e) {
				FinderCacheUtil.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return list;
	}

	/**
	 * Removes all the trasporto documentos from the database.
	 *
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public void removeAll() throws SystemException {
		for (TrasportoDocumento trasportoDocumento : findAll()) {
			remove(trasportoDocumento);
		}
	}

	/**
	 * Returns the number of trasporto documentos.
	 *
	 * @return the number of trasporto documentos
	 * @throws SystemException if a system exception occurred
	 */
	@Override
	public int countAll() throws SystemException {
		Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, this);

		if (count == null) {
			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(_SQL_COUNT_TRASPORTODOCUMENTO);

				count = (Long)q.uniqueResult();

				FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
					FINDER_ARGS_EMPTY, count);
			}
			catch (Exception e) {
				FinderCacheUtil.removeResult(FINDER_PATH_COUNT_ALL,
					FINDER_ARGS_EMPTY);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}

	/**
	 * Initializes the trasporto documento persistence.
	 */
	public void afterPropertiesSet() {
		String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
					com.liferay.util.service.ServiceProps.get(
						"value.object.listener.it.apuliait.model.TrasportoDocumento")));

		if (listenerClassNames.length > 0) {
			try {
				List<ModelListener<TrasportoDocumento>> listenersList = new ArrayList<ModelListener<TrasportoDocumento>>();

				for (String listenerClassName : listenerClassNames) {
					listenersList.add((ModelListener<TrasportoDocumento>)InstanceFactory.newInstance(
							getClassLoader(), listenerClassName));
				}

				listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
			}
			catch (Exception e) {
				_log.error(e);
			}
		}
	}

	public void destroy() {
		EntityCacheUtil.removeCache(TrasportoDocumentoImpl.class.getName());
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}

	private static final String _SQL_SELECT_TRASPORTODOCUMENTO = "SELECT trasportoDocumento FROM TrasportoDocumento trasportoDocumento";
	private static final String _SQL_COUNT_TRASPORTODOCUMENTO = "SELECT COUNT(trasportoDocumento) FROM TrasportoDocumento trasportoDocumento";
	private static final String _ORDER_BY_ENTITY_ALIAS = "trasportoDocumento.";
	private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No TrasportoDocumento exists with the primary key ";
	private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = GetterUtil.getBoolean(PropsUtil.get(
				PropsKeys.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE));
	private static Log _log = LogFactoryUtil.getLog(TrasportoDocumentoPersistenceImpl.class);
	private static TrasportoDocumento _nullTrasportoDocumento = new TrasportoDocumentoImpl() {
			@Override
			public Object clone() {
				return this;
			}

			@Override
			public CacheModel<TrasportoDocumento> toCacheModel() {
				return _nullTrasportoDocumentoCacheModel;
			}
		};

	private static CacheModel<TrasportoDocumento> _nullTrasportoDocumentoCacheModel =
		new CacheModel<TrasportoDocumento>() {
			@Override
			public TrasportoDocumento toEntityModel() {
				return _nullTrasportoDocumento;
			}
		};
}